home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / Buch / Obutton2.h < prev    next >
C/C++ Source or Header  |  1999-01-22  |  2KB  |  75 lines

  1. //---------------------------------------------------------------------------
  2. #ifndef ObuttonH
  3. #define ObuttonH
  4. //---------------------------------------------------------------------------
  5. #include <vcl\SysUtils.hpp>
  6. #include <vcl\Controls.hpp>
  7. #include <vcl\Classes.hpp>
  8. #include <vcl\Forms.hpp>
  9. #include <vcl\ExtCtrls.hpp>
  10. //---------------------------------------------------------------------------
  11. class TOButton : public TCustomControl
  12. {
  13. private:
  14.   TColor Color;
  15.   void __fastcall SetColor(TColor OBrush, TColor OPen);
  16. protected:
  17.   bool Pressed;
  18.   virtual void __fastcall Paint(void);
  19.   virtual void __fastcall MouseDown
  20.     (TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
  21.   virtual void __fastcall MouseUp
  22.     (TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
  23. public:
  24.   void __fastcall SetSize (TRect Rechteck);
  25.   __fastcall TOButton(TComponent* Owner);
  26.   __fastcall TOButton(TComponent* Owner, TColor Farbe);
  27.   __fastcall TOButton(TComponent* Owner, TRect Rechteck);
  28. __published:
  29.   __property OnClick;
  30.   __property OnDblClick;
  31.   __property OnMouseDown;
  32.   __property OnMouseUp;
  33.   __property OnMouseMove;
  34.   __property OnStartDrag;
  35.   __property OnEndDrag;
  36.   __property OnDragDrop;
  37.   __property OnDragOver;
  38.   __property OnEnter;
  39.   __property OnExit;
  40.   __property OnKeyPress;
  41.   __property OnKeyDown;
  42.   __property OnKeyUp;
  43. };
  44.  
  45. class TOOButton : public TOButton
  46. {
  47. protected:
  48.   virtual void __fastcall MouseDown
  49.     (TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
  50.   virtual void __fastcall MouseUp
  51.     (TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
  52. public:
  53.   __fastcall TOOButton(TComponent* Owner);
  54.   __fastcall TOOButton(TComponent* Owner, TColor Farbe);
  55.   __fastcall TOOButton(TComponent* Owner, TRect Rechteck);
  56. __published:
  57.   __property OnClick;
  58.   __property OnDblClick;
  59.   __property OnMouseDown;
  60.   __property OnMouseUp;
  61.   __property OnMouseMove;
  62.   __property OnStartDrag;
  63.   __property OnEndDrag;
  64.   __property OnDragDrop;
  65.   __property OnDragOver;
  66.   __property OnEnter;
  67.   __property OnExit;
  68.   __property OnKeyPress;
  69.   __property OnKeyDown;
  70.   __property OnKeyUp;
  71. };
  72.  
  73. //---------------------------------------------------------------------------
  74. #endif
  75.